/**
 * Copyright(C) 2012 Luvina Software Company
 *
 * UserManaged.java, 08/01/2013, bacdv
 */
package net.luvina.manageuser.managedbean;

import net.luvina.manageuser.constant.CommonConstant;
import net.luvina.manageuser.dto.UserDetailDto;
import net.luvina.manageuser.hibernate.MstGroup;
import net.luvina.manageuser.hibernate.TblDetailUserJapan;
import net.luvina.manageuser.hibernate.TblUser;
import net.luvina.manageuser.logic.MstGroupLogic;
import net.luvina.manageuser.logic.MstJapanLogic;
import net.luvina.manageuser.logic.TblUserLogic;
import net.luvina.manageuser.util.CommonUtil;
import net.luvina.manageuser.util.ConfigProperties;
import net.luvina.manageuser.util.Message;
import net.luvina.manageuser.util.StringUtil;

import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.model.SelectItem;
import javax.servlet.http.HttpServletRequest;

/**
 * user manager
 *
 * @author bacdv
 *
 */
@Component("userManaged")
@Scope("request")
public class UserManaged extends UserBaseManaged implements Serializable {
    private static final long serialVersionUID = 1L;
    private Date birthday;
    private Date endDate;
    private Date startDate;
    private Integer detailUserJapanId;
    private Integer userId;
    private Integer birthdayDay;
    private Integer birthdayMonth;
    private Integer birthdayYear;
    private Integer endDay;
    private Integer endMonth;
    private Integer endYear;
    private Integer groupId;
    private Integer startDay;
    private Integer startMonth;
    private Integer startYear;
    private Integer total;
    private String totalStr;
    private String codeLevel;
    private String codeName;
    private String email;
    private String tel;
    private String fullName;
    private String fullNameKana;
    private String groupName;
    private String loginName;
    private String password;
    private String passwordConfirm;
    private String strBirthday;
    private String strEndDate;
    private String strStartDate;
    private String message;
    private List<SelectItem> lsItemBirthdayDay;
    private List<SelectItem> lsItemBirthdayMonth;
    private List<SelectItem> lsItemBirthdayYear;
    private List<SelectItem> lsItemEndDay;
    private List<SelectItem> lsItemEndMonth;
    private List<SelectItem> lsItemEndYear;
    private List<SelectItem> lsItemGroup;
    private List<SelectItem> lsItemJapan;
    private List<SelectItem> lsItemStartDay;
    private List<SelectItem> lsItemStartMonth;
    private List<SelectItem> lsItemStartYear;
    private List<String> lsErrorMessage;
    @Autowired
    private MstGroupLogic mstGroupLogic;
    @Autowired
    private MstJapanLogic mstJapanLogic;
    @Autowired
    private TblUserLogic tblUserLogic;
    @Autowired
    UserSession userSession;

    private String frmMessage;

    /**
     * Constructor
     */
    public UserManaged() {
    }

    /**
     * init page
     *
     * @param event
     *            phase event
     */
    public final void initPage(PhaseEvent event) {
        this.lsItemGroup = mstGroupLogic.getListItemGroup(ConfigProperties
                .getData("please_select"));
        this.lsItemBirthdayYear = CommonUtil.getListSelectItemYear();
        this.lsItemBirthdayMonth = CommonUtil.getListSelectItemMonth();
        this.lsItemBirthdayDay = CommonUtil.getListSelectItemDay();
        this.lsItemStartYear = CommonUtil.getListSelectItemYear();
        this.lsItemStartMonth = CommonUtil.getListSelectItemMonth();
        this.lsItemStartDay = CommonUtil.getListSelectItemDay();
        this.lsItemEndYear = CommonUtil.getListSelectItemYear();
        int year = CommonUtil.getYearNow() + 1;
        this.lsItemEndYear.add(new SelectItem(Integer.toString(year), Integer
                .toString(year)));
        this.lsItemEndMonth = CommonUtil.getListSelectItemMonth();
        this.lsItemEndDay = CommonUtil.getListSelectItemDay();
        this.lsItemJapan = mstJapanLogic.getListItemJapan(ConfigProperties
                .getData("please_select"));
        this.setDefaultValue();
    }

    /**
     * set value default for screen ADM003
     */
    private void setDefaultValue() {
        this.setFrmMessage(Message.getString("MSG004"));
        Date nowDate = new Date();
        List<Integer> listIntegerYMD = CommonUtil.toArrayInteger(nowDate);
        int index = 0;
        if (birthdayYear == null) {
            birthdayYear = listIntegerYMD.get(index++);
        }
        if (birthdayMonth == null) {
            birthdayMonth = listIntegerYMD.get(index++);
        }
        if (birthdayDay == null) {
            birthdayDay = listIntegerYMD.get(index++);
        }

        int indexStart = 0;
        if (startYear == null) {
            startYear = listIntegerYMD.get(indexStart++);
        }
        if (startMonth == null) {
            startMonth = listIntegerYMD.get(indexStart++);
        }
        if (startDay == null) {
            startDay = listIntegerYMD.get(indexStart++);
        }

        int indexEnd = 0;
        if (endYear == null) {
            endYear = listIntegerYMD.get(indexEnd++) + 1;
        }
        if (endMonth == null) {
            endMonth = listIntegerYMD.get(indexEnd++);
        }
        if (endDay == null) {
            endDay = listIntegerYMD.get(indexEnd++);
        }
    }

    /**
     * Register
     *
     * @return ADM003
     */
    public String doRegist() {
        return CommonConstant.ADM003;
    }

    /**
     * confirm action
     *
     * @return String
     */
    public String doConfirm() {
        this.validate();
        if (this.lsErrorMessage != null && this.lsErrorMessage.size() > 0) {
            return "validateError";
        }
        if (this.groupId > 0) {
            for (SelectItem si : this.lsItemGroup) {
                if (si.getValue() != null && !"".equals(si.getValue())) {
                    if (this.groupId == Integer.parseInt(si.getValue()
                            .toString())) {
                        this.groupName = si.getLabel();
                        break;
                    }
                }
            }
        }
        if (!"0".equals(this.codeLevel)) {
            for (SelectItem si : this.lsItemJapan) {
                if (si.getValue() != null && !"".equals(si.getValue())) {
                    if (this.codeLevel.equals(si.getValue())) {
                        this.codeName = si.getLabel();
                        break;
                    }
                }
            }
            this.strStartDate = CommonUtil.convertToString(startYear,
                    startMonth, startDay);
            this.startDate = CommonUtil.toDate(startYear, startMonth, startDay);
            this.strEndDate = CommonUtil.convertToString(endYear, endMonth,
                    endDay);
            this.endDate = CommonUtil.toDate(endYear, endMonth, endDay);
            this.total = CommonUtil.toInteger(this.totalStr);
        }
        this.strBirthday = CommonUtil.convertToString(birthdayYear,
                birthdayMonth, birthdayDay);
        this.birthday = CommonUtil.toDate(birthdayYear, birthdayMonth,
                birthdayDay);

        try {
            BeanUtils.copyProperties(this.userSession, this);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return CommonConstant.ADM004;
    }

    /**
     * Check validate
     */
    private void validate() {
        this.lsErrorMessage = new ArrayList<String>();
        if (this.userId <= 0) {
            if (tblUserLogic.checkExistedLoginName(userId, loginName)) {
                this.lsErrorMessage.add(MessageFormat.format(Message
                        .getString("ER003"), Message.getString("LB001")));
            }
        }
        if (this.fullName.length() > 255) {
            this.lsErrorMessage.add(MessageFormat.format(Message
                    .getString("ER006"), 255, Message.getString("LB003")));
        }
        if (!StringUtil.isDate(this.birthdayYear, this.birthdayMonth,
                this.birthdayDay)) {
            this.lsErrorMessage.add(MessageFormat.format(Message
                    .getString("ER004"), Message.getString("LB005")));
        }
        if (this.userId <= 0) {
            if (tblUserLogic.checkExistedEmail(userId, email)) {
                this.lsErrorMessage.add(MessageFormat.format(Message
                        .getString("ER003"), Message.getString("LB006")));
            }
        }
        if (!this.password.equals(this.passwordConfirm)) {
            this.lsErrorMessage.add(MessageFormat.format(Message
                    .getString("ER017"), Message.getString("LB009")));
        }
        if (this.groupId == 0) {
            this.lsErrorMessage.add(MessageFormat.format(Message
                    .getString("ER002"), Message.getString("LB002")));
        }
        if (!"0".equals(this.codeLevel)) {
            this.startDate = CommonUtil.toDate(this.startYear, this.startMonth,
                    this.startDay);
            this.endDate = CommonUtil.toDate(this.endYear, this.endMonth,
                    this.endDay);
            if (!StringUtil.isDate(this.startYear, this.startMonth,
                    this.startDay)) {
                this.lsErrorMessage.add(MessageFormat.format(Message
                        .getString("ER011"), Message.getString("LB011")));
            }
            if (!StringUtil.isDate(this.endYear, this.endMonth, this.endDay)) {
                this.lsErrorMessage.add(MessageFormat.format(Message
                        .getString("ER011"), Message.getString("LB012")));
            }
            if (startDate != null && endDate != null) {
                if (!this.startDate.before(this.endDate)) {
                    this.lsErrorMessage.add(MessageFormat.format(Message
                            .getString("ER012"), Message.getString("LB012"),
                            Message.getString("LB011")));
                }
            }
            if (this.totalStr == null || "".equals(this.totalStr)) {
                this.lsErrorMessage.add(MessageFormat.format(Message
                        .getString("ER001"), Message.getString("LB013")));
            } else if (!StringUtil.isHalfsizeNumber(totalStr)) {
                this.lsErrorMessage.add(MessageFormat.format(Message
                        .getString("ER018"), Message.getString("LB013")));
            }
        }
    }

    /**
     *
     * @return String ADM006
     */
    public String doDone() {
        if (this.userSession.getUserId() == null) {
            this.message = userSession.getMessage();
            return CommonConstant.ADM006;
        }
        Boolean result = true;
        MstGroup mstGroup = new MstGroup();
        mstGroup.setGroupId(this.userSession.getGroupId());
        TblUser tblUser = new TblUser();
        this.userId = this.userSession.getUserId();
        tblUser.setLoginName(this.userSession.getLoginName());
        tblUser.setPassword(this.userSession.getPassword());
        tblUser.setMstGroup(mstGroup);
        tblUser.setFullName(this.userSession.getFullName());
        tblUser.setFullNameKana(this.userSession.getFullNameKana());
        tblUser.setEmail(this.userSession.getEmail());
        tblUser.setTel(this.userSession.getTel());
        tblUser.setBirthday(this.userSession.getBirthday());
        if (!"0".equals(this.codeLevel)) {
            TblDetailUserJapan tblDetailUserJapan = new TblDetailUserJapan();
            tblDetailUserJapan.setDetailUserJapanId(this.userSession
                    .getDetailUserJapanId());
            tblDetailUserJapan.setCodeLevel(this.userSession.getCodeLevel());
            tblDetailUserJapan.setStartDate(this.userSession.getStartDate());
            tblDetailUserJapan.setEndDate(this.userSession.getEndDate());
            tblDetailUserJapan.setUserId(this.userId);
            tblDetailUserJapan.setTotal(this.userSession.getTotal());
            tblUser.setTblDetailUserJapan(tblDetailUserJapan);
        }
        if (this.userId > 0) {
            tblUser.setUserId(this.userId);
            result = this.tblUserLogic.updateUser(tblUser);
        } else {
            result = this.tblUserLogic.createUser(tblUser);
        }
        userSession.clear();

        if (!result) {
            this.message = Message.getString("ER015");
            return CommonConstant.SYS_ERROR;
        } else {
            if (this.userId > 0) {
                this.message = Message.getString("MSG002");
            } else {
                this.message = Message.getString("MSG001");
            }
            userSession.setMessage(message);
            return CommonConstant.ADM006;
        }
    }

    /**
     * edit user
     *
     * @return String
     */
    public String doEdit() {
        if (userId > 0) {
            this.processData(this.userId);
            List<Integer> listBirthday = CommonUtil
                    .toArrayInteger(this.birthday);
            int index = 0;
            if (birthdayYear == null) {
                birthdayYear = listBirthday.get(index++);
            }
            if (birthdayMonth == null) {
                birthdayMonth = listBirthday.get(index++);
            }
            if (birthdayDay == null) {
                birthdayDay = listBirthday.get(index++);
            }
            if (this.detailUserJapanId > 0) {
                List<Integer> listStartDate = CommonUtil
                        .toArrayInteger(this.startDate);
                int indexStart = 0;
                if (startYear == null) {
                    startYear = listStartDate.get(indexStart++);
                }
                if (startMonth == null) {
                    startMonth = listStartDate.get(indexStart++);
                }
                if (startDay == null) {
                    startDay = listStartDate.get(indexStart++);
                }
                List<Integer> listEndDate = CommonUtil
                        .toArrayInteger(this.endDate);
                int indexEnd = 0;
                if (endYear == null) {
                    endYear = listEndDate.get(indexEnd++) + 1;
                }
                if (endMonth == null) {
                    endMonth = listEndDate.get(indexEnd++);
                }
                if (endDay == null) {
                    endDay = listEndDate.get(indexEnd++);
                }
            }
            return CommonConstant.ADM003;
        } else {
            return CommonConstant.SYS_ERROR;
        }
    }

    /**
     * delete user
     *
     * @return String
     */
    public String doDelete() {
        TblUser tblUser = new TblUser();
        boolean result = false;
        if (userId > 0) {
            tblUser = tblUserLogic.getUserById(userId);
            if (tblUser == null) {
                this.message = userSession.getMessage();
                return CommonConstant.ADM006;
            }
            result = tblUserLogic.deleteUser(tblUser);
            if (result) {
                this.message = Message.getString("MSG003");
                userSession.setMessage(this.message);
                return CommonConstant.ADM006;
            } else {
                return CommonConstant.SYS_ERROR;
            }
        } else {
            return CommonConstant.SYS_ERROR;
        }
    }

    /**
     * user detail
     *
     * @return String
     */
    public String doDetail() {
        HttpServletRequest request = (HttpServletRequest) FacesContext
                .getCurrentInstance().getExternalContext().getRequest();
        String strUserId = request.getParameter("userId");
        if (strUserId != null || "".equals(strUserId)) {
            this.userId = Integer.valueOf(strUserId);
        } else {
            this.userId = 0;
        }
        if (this.userId > 0) {
            tblUserLogic.getUserById(this.userId);
            this.processData(this.userId);
            return CommonConstant.ADM005;
        } else {
            return CommonConstant.SYS_ERROR;
        }
    }

    /**
     * set data to ADM003
     *
     * @return true if set data success/ false if set data fail
     */
    private boolean processData(int userId) {
        UserDetailDto userDetailDto = new UserDetailDto();
        userDetailDto = tblUserLogic.getDetailUserById(userId);
        if (userDetailDto != null) {
            this.setUserId(userDetailDto.getUserId());
            this.setGroupId(userDetailDto.getGroupId());
            this.setFullNameKana(userDetailDto.getFullNameKana());
            this.setCodeLevel(userDetailDto.getCodeLevel());
            this.setEmail(userDetailDto.getEmail());
            this.setFullName(userDetailDto.getFullName());
            this.setGroupName(userDetailDto.getGroupName());
            this.setLoginName(userDetailDto.getLoginName());
            this.setTel(userDetailDto.getTel());
            this.setBirthday(userDetailDto.getBirthday());
            if (userDetailDto.getDetailUserJapanId() != null) {
                this.setCodeName(userDetailDto.getNameLevel());
                this.setStartDate(userDetailDto.getStartDate());
                this.setEndDate(userDetailDto.getEndDate());
                this.setTotalStr(userDetailDto.getTotal().toString());
                this.setTotal(userDetailDto.getTotal());
                this.setDetailUserJapanId(userDetailDto.getDetailUserJapanId());
            }
            return true;
        } else {
            return false;
        }
    }

    /**
     * back to screen ADM003
     *
     * @return String
     */
    public String doBack() {
        try {
            BeanUtils.copyProperties(this, this.userSession);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return CommonConstant.ADM003;
    }

    /**
     * @return the birthday
     */
    public Date getBirthday() {
        return birthday;
    }

    /**
     * @param birthday
     *            the birthday to set
     */
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    /**
     * @return the endDate
     */
    public Date getEndDate() {
        return endDate;
    }

    /**
     * @param endDate
     *            the endDate to set
     */
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    /**
     * @return the startDate
     */
    public Date getStartDate() {
        return startDate;
    }

    /**
     * @param startDate
     *            the startDate to set
     */
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    /**
     * @return the userId
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * @param userId
     *            the userId to set
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * @return the birthdayDay
     */
    public Integer getBirthdayDay() {
        return birthdayDay;
    }

    /**
     * @param birthdayDay
     *            the birthdayDay to set
     */
    public void setBirthdayDay(Integer birthdayDay) {
        this.birthdayDay = birthdayDay;
    }

    /**
     * @return the birthdayMonth
     */
    public Integer getBirthdayMonth() {
        return birthdayMonth;
    }

    /**
     * @param birthdayMonth
     *            the birthdayMonth to set
     */
    public void setBirthdayMonth(Integer birthdayMonth) {
        this.birthdayMonth = birthdayMonth;
    }

    /**
     * @return the birthdayYear
     */
    public Integer getBirthdayYear() {
        return birthdayYear;
    }

    /**
     * @param birthdayYear
     *            the birthdayYear to set
     */
    public void setBirthdayYear(Integer birthdayYear) {
        this.birthdayYear = birthdayYear;
    }

    /**
     * @return the endDay
     */
    public Integer getEndDay() {
        return endDay;
    }

    /**
     * @param endDay
     *            the endDay to set
     */
    public void setEndDay(Integer endDay) {
        this.endDay = endDay;
    }

    /**
     * @return the endMonth
     */
    public Integer getEndMonth() {
        return endMonth;
    }

    /**
     * @param endMonth
     *            the endMonth to set
     */
    public void setEndMonth(Integer endMonth) {
        this.endMonth = endMonth;
    }

    /**
     * @return the endYear
     */
    public Integer getEndYear() {
        return endYear;
    }

    /**
     * @param endYear
     *            the endYear to set
     */
    public void setEndYear(Integer endYear) {
        this.endYear = endYear;
    }

    /**
     * @return the groupId
     */
    public Integer getGroupId() {
        return groupId;
    }

    /**
     * @param groupId
     *            the groupId to set
     */
    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    /**
     * @return the startDay
     */
    public Integer getStartDay() {
        return startDay;
    }

    /**
     * @param startDay
     *            the startDay to set
     */
    public void setStartDay(Integer startDay) {
        this.startDay = startDay;
    }

    /**
     * @return the startMonth
     */
    public Integer getStartMonth() {
        return startMonth;
    }

    /**
     * @param startMonth
     *            the startMonth to set
     */
    public void setStartMonth(Integer startMonth) {
        this.startMonth = startMonth;
    }

    /**
     * @return the startYear
     */
    public Integer getStartYear() {
        return startYear;
    }

    /**
     * @param startYear
     *            the startYear to set
     */
    public void setStartYear(Integer startYear) {
        this.startYear = startYear;
    }

    /**
     * @return the total
     */
    public Integer getTotal() {
        return total;
    }

    /**
     * @param total
     *            the total to set
     */
    public void setTotal(Integer total) {
        this.total = total;
    }

    /**
     * @return the totalStr
     */
    public String getTotalStr() {
        return totalStr;
    }

    /**
     * @param totalStr
     *            the totalStr to set
     */
    public void setTotalStr(String totalStr) {
        this.totalStr = totalStr;
    }

    /**
     * @return the codeLevel
     */
    public String getCodeLevel() {
        return codeLevel;
    }

    /**
     * @param codeLevel
     *            the codeLevel to set
     */
    public void setCodeLevel(String codeLevel) {
        this.codeLevel = codeLevel;
    }

    /**
     * @return the codeName
     */
    public String getCodeName() {
        return codeName;
    }

    /**
     * @param codeName
     *            the codeName to set
     */
    public void setCodeName(String codeName) {
        this.codeName = codeName;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email
     *            the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the tel
     */
    public String getTel() {
        return tel;
    }

    /**
     * @param tel
     *            the tel to set
     */
    public void setTel(String tel) {
        this.tel = tel;
    }

    /**
     * @return the fullName
     */
    public String getFullName() {
        return fullName;
    }

    /**
     * @param fullName
     *            the fullName to set
     */
    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    /**
     * @return the fullNameKana
     */
    public String getFullNameKana() {
        return fullNameKana;
    }

    /**
     * @param fullNameKana
     *            the fullNameKana to set
     */
    public void setFullNameKana(String fullNameKana) {
        this.fullNameKana = fullNameKana;
    }

    /**
     * @return the groupName
     */
    public String getGroupName() {
        return groupName;
    }

    /**
     * @param groupName
     *            the groupName to set
     */
    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    /**
     * @return the loginName
     */
    public String getLoginName() {
        return loginName;
    }

    /**
     * @param loginName
     *            the loginName to set
     */
    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password
     *            the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return the passwordConfirm
     */
    public String getPasswordConfirm() {
        return passwordConfirm;
    }

    /**
     * @param passwordConfirm
     *            the passwordConfirm to set
     */
    public void setPasswordConfirm(String passwordConfirm) {
        this.passwordConfirm = passwordConfirm;
    }

    /**
     * @return the strBirthday
     */
    public String getStrBirthday() {
        return strBirthday;
    }

    /**
     * @param strBirthday
     *            the strBirthday to set
     */
    public void setStrBirthday(String strBirthday) {
        this.strBirthday = strBirthday;
    }

    /**
     * @return the strEndDate
     */
    public String getStrEndDate() {
        return strEndDate;
    }

    /**
     * @param strEndDate
     *            the strEndDate to set
     */
    public void setStrEndDate(String strEndDate) {
        this.strEndDate = strEndDate;
    }

    /**
     * @return the strStartDate
     */
    public String getStrStartDate() {
        return strStartDate;
    }

    /**
     * @param strStartDate
     *            the strStartDate to set
     */
    public void setStrStartDate(String strStartDate) {
        this.strStartDate = strStartDate;
    }

    /**
     * @return the message
     */
    public String getMessage() {
        return message;
    }

    /**
     * @param message
     *            the message to set
     */
    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * @return the lsItemBirthdayDay
     */
    public List<SelectItem> getLsItemBirthdayDay() {
        return lsItemBirthdayDay;
    }

    /**
     * @param lsItemBirthdayDay
     *            the lsItemBirthdayDay to set
     */
    public void setLsItemBirthdayDay(List<SelectItem> lsItemBirthdayDay) {
        this.lsItemBirthdayDay = lsItemBirthdayDay;
    }

    /**
     * @return the lsItemBirthdayMonth
     */
    public List<SelectItem> getLsItemBirthdayMonth() {
        return lsItemBirthdayMonth;
    }

    /**
     * @param lsItemBirthdayMonth
     *            the lsItemBirthdayMonth to set
     */
    public void setLsItemBirthdayMonth(List<SelectItem> lsItemBirthdayMonth) {
        this.lsItemBirthdayMonth = lsItemBirthdayMonth;
    }

    /**
     * @return the lsItemBirthdayYear
     */
    public List<SelectItem> getLsItemBirthdayYear() {
        return lsItemBirthdayYear;
    }

    /**
     * @param lsItemBirthdayYear
     *            the lsItemBirthdayYear to set
     */
    public void setLsItemBirthdayYear(List<SelectItem> lsItemBirthdayYear) {
        this.lsItemBirthdayYear = lsItemBirthdayYear;
    }

    /**
     * @return the lsItemEndDay
     */
    public List<SelectItem> getLsItemEndDay() {
        return lsItemEndDay;
    }

    /**
     * @param lsItemEndDay
     *            the lsItemEndDay to set
     */
    public void setLsItemEndDay(List<SelectItem> lsItemEndDay) {
        this.lsItemEndDay = lsItemEndDay;
    }

    /**
     * @return the lsItemEndMonth
     */
    public List<SelectItem> getLsItemEndMonth() {
        return lsItemEndMonth;
    }

    /**
     * @param lsItemEndMonth
     *            the lsItemEndMonth to set
     */
    public void setLsItemEndMonth(List<SelectItem> lsItemEndMonth) {
        this.lsItemEndMonth = lsItemEndMonth;
    }

    /**
     * @return the lsItemEndYear
     */
    public List<SelectItem> getLsItemEndYear() {
        return lsItemEndYear;
    }

    /**
     * @param lsItemEndYear
     *            the lsItemEndYear to set
     */
    public void setLsItemEndYear(List<SelectItem> lsItemEndYear) {
        this.lsItemEndYear = lsItemEndYear;
    }

    /**
     * @return the lsItemGroup
     */
    public List<SelectItem> getLsItemGroup() {
        return lsItemGroup;
    }

    /**
     * @param lsItemGroup
     *            the lsItemGroup to set
     */
    public void setLsItemGroup(List<SelectItem> lsItemGroup) {
        this.lsItemGroup = lsItemGroup;
    }

    /**
     * @return the lsItemJapan
     */
    public List<SelectItem> getLsItemJapan() {
        return lsItemJapan;
    }

    /**
     * @param lsItemJapan
     *            the lsItemJapan to set
     */
    public void setLsItemJapan(List<SelectItem> lsItemJapan) {
        this.lsItemJapan = lsItemJapan;
    }

    /**
     * @return the lsItemStartDay
     */
    public List<SelectItem> getLsItemStartDay() {
        return lsItemStartDay;
    }

    /**
     * @param lsItemStartDay
     *            the lsItemStartDay to set
     */
    public void setLsItemStartDay(List<SelectItem> lsItemStartDay) {
        this.lsItemStartDay = lsItemStartDay;
    }

    /**
     * @return the lsItemStartMonth
     */
    public List<SelectItem> getLsItemStartMonth() {
        return lsItemStartMonth;
    }

    /**
     * @param lsItemStartMonth
     *            the lsItemStartMonth to set
     */
    public void setLsItemStartMonth(List<SelectItem> lsItemStartMonth) {
        this.lsItemStartMonth = lsItemStartMonth;
    }

    /**
     * @return the lsItemStartYear
     */
    public List<SelectItem> getLsItemStartYear() {
        return lsItemStartYear;
    }

    /**
     * @param lsItemStartYear
     *            the lsItemStartYear to set
     */
    public void setLsItemStartYear(List<SelectItem> lsItemStartYear) {
        this.lsItemStartYear = lsItemStartYear;
    }

    /**
     * @return the lsErrorMessage
     */
    public List<String> getLsErrorMessage() {
        return lsErrorMessage;
    }

    /**
     * @param lsErrorMessage
     *            the lsErrorMessage to set
     */
    public void setLsErrorMessage(List<String> lsErrorMessage) {
        this.lsErrorMessage = lsErrorMessage;
    }

    /**
     * @return the mstGroupLogic
     */
    public MstGroupLogic getMstGroupLogic() {
        return mstGroupLogic;
    }

    /**
     * @param mstGroupLogic
     *            the mstGroupLogic to set
     */
    public void setMstGroupLogic(MstGroupLogic mstGroupLogic) {
        this.mstGroupLogic = mstGroupLogic;
    }

    /**
     * @return the mstJapanLogic
     */
    public MstJapanLogic getMstJapanLogic() {
        return mstJapanLogic;
    }

    /**
     * @param mstJapanLogic
     *            the mstJapanLogic to set
     */
    public void setMstJapanLogic(MstJapanLogic mstJapanLogic) {
        this.mstJapanLogic = mstJapanLogic;
    }

    /**
     * @return the tblUserLogic
     */
    public TblUserLogic getTblUserLogic() {
        return tblUserLogic;
    }

    /**
     * @param tblUserLogic
     *            the tblUserLogic to set
     */
    public void setTblUserLogic(TblUserLogic tblUserLogic) {
        this.tblUserLogic = tblUserLogic;
    }

    /**
     * @return the userSession
     */
    public UserSession getUserSession() {
        return userSession;
    }

    /**
     * @param userSession
     *            the userSession to set
     */
    public void setUserSession(UserSession userSession) {
        this.userSession = userSession;
    }

    /**
     * @param detailUserJapanId
     *            the detailUserJapanId to set
     */
    public void setDetailUserJapanId(Integer detailUserJapanId) {
        this.detailUserJapanId = detailUserJapanId;
    }

    /**
     * @return the detailUserJapanId
     */
    public Integer getDetailUserJapanId() {
        return detailUserJapanId;
    }

    /**
     * @param frmMessage
     *            the frmMessage to set
     */
    public void setFrmMessage(String frmMessage) {
        this.frmMessage = frmMessage;
    }

    /**
     * @return the frmMessage
     */
    public String getFrmMessage() {
        return frmMessage;
    }

}